<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
 * 微信群发文章表，用来记录图文列表和图文
 * @package App\Models
 */
class WxMassArticle extends Model
{
    use SoftDeletes;
    //主键
    protected $primaryKey = 'id';
    protected $dateFormat = 'Y-m-d H:i:s';
    /**
     * 应该被转换成原生类型的属性。
     * @var array
     */
    protected $casts = [
    ];
    /**
     * 可以被批量赋值的属性
     * @var array
     */
    protected $fillable = [
        'mass_id','msg_data_id','new_id','index_num','title','open_comment',
        'user_declare_state','audit_state','original_article_url','original_article_type','can_reprint','need_replace_content','need_show_reprint_source'
    ];

    /**
     * 群发关联
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function mass()
    {
        return $this->belongsTo('App\Models\WxMass','msg_id', 'msg_id');
    }
}
